#ifndef _TCP_SERVER_H_H_H
#define _TCP_SERVER_H_H_H

#include <event2/event.h>

class TcpServer
{
public:
    TcpServer();
    ~TcpServer();

public:
    void start_server(int port);

protected:
    static void listener_cb(struct evconnlistener *listener, evutil_socket_t fd, struct sockaddr *sa, int socklen, void *arg);
    static void conn_read_cb(struct bufferevent *bev, void *arg);
    static void conn_write_cb(struct bufferevent *bev, void *arg);
    static void conn_event_cb(struct bufferevent *bev, short events, void *arg);
    static void signal_cb(evutil_socket_t sig, short events, void *arg);
};

#endif // _TCP_SERVER_H_H_H
